/*
 *
 *  Created on: Jul 13, 2012
 *      Author: Guannan Ma  
 *      @mythmgn

 *      Whatever license Applied.
 */

#include "base.h"

#ifdef __linux__
#include <pwd.h>
#include <sys/types.h>
#endif

#ifndef BASE_LIB_SYSUTIL_H
#define BASE_LIB_SYSUTIL_H

#ifdef __cplusplus
extern "C"{
#endif

typedef struct PhyMemInfo{
	long used;
	long free;
	long total;
}PhyMemInfo;

long getTotalPhyMemory();
long getAvailPhyMem();
long getUsedPhyMem();
unsigned int getPhyMemInfo(PhyMemInfo *mem);

#ifdef __linux__
BOOL isRunUnderRoot();
const struct passwd *getUserPW(const char* strUName);
#endif
#if defined __cplusplus
}
#endif

#endif /* SYSUTIL_H_ */
